Socket
Socket
Sign inDemoInstall

@4c/import-sort

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@4c/import-sort

An [import-sort](https://github.com/renke/import-sort#import-sort) style config and custom parser for Javascript and Typescript (using babel).


Version published
Weekly downloads
8
decreased by-65.22%
Maintainers
4
Weekly downloads
 
Created
Source

@4c/import-sort

An import-sort style config and custom parser for Javascript and Typescript (using babel).

Install

yarn add -D @4c/import-sort

Configuration

In a package.json:

{
  "importSort": {
    ".js": {
      "parser": "@4c/import-sort/parser",
      "style": "@4c/import-sort"
    },
    ".ts, .tsx": {
      "parser": "@4c/import-sort/parser-ts",
      "style": "@4c/import-sort"
    }
  }
}

Style

Imports are sorted into three groups: third party code, local code, styles and assets

import fs from 'fs'; // Node core modules first
import pick from 'lodash/pick'; // third party deps
import Env from '@4c/env'; // scoped

import Foo from '../Foo'; // local, in shared.
import Bar from './Bar';
import Baz from './Baz';

import styles from 'styles.scss'; // style imports

FAQs

Package last updated on 08 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc